<?php session_start();
	ob_start();
	//memanggil koneksi ke database
	include_once("connect.php");
	//mengambil data dari database table tbl_user
	$User= $_POST['username'];
	$Pass= $_POST['password'];
	$getLogin=mysql_fetch_array(mysql_query("select * from member where USERNAME='$User' and PASSWORD='$Pass'"));
	if(empty($User) || empty($Pass) )
	{
		echo "<script>alert('all must be filled');window.location='form-login.php';</script>"; 
	}
	else
	{
		if ($getLogin)
		{ 
			$_SESSION['logged-in']=true;
			$_SESSION['username']=$User;
			
			header('Location: commit_trans.php');

			// echo "<script>alert('transaksi selesai diproses, silahkan masuk ke menu transaksi yang ada di kiri bawah page untuk melihat bukti transaksi');window.location='index.php';</script>"; 

		}
		else 
		{	
				echo "<script>alert('gagal');window.location='form-login.php';</script>"; 
		}
	}
		ob_flush();
?>